﻿using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Media;
using SomeGame.Actors.Components;
using SomeGame.Actors.Components.Health;
using SomeGame.Actors.Components.Mind;
using SomeGame.Actors.Components.Movement;
using SomeGame.Actors.Components.State;
using SomeGame.Actors.Types;

namespace SomeGame.Zones {

	public static class ZoneManager {

		public static Zone CurrentZone;
		public static ContentManager ContentManager;

		static ZoneManager() {
			ContentManager = new ContentManager(GameEngine.ContentManager.ServiceProvider,
				GameEngine.ContentManager.RootDirectory);
		}

		public static void LoadZone(string zoneName) {
			// TODO: Rehydrates a Zone object from file. Wouldn't be a 'new' here, just a Deserialization.
			// TODO: Since there isn't any Deserialization code, fake it here.

			//=====( Begin Zone Basics )===========================================================

			/*
             * Unload current zone and load new one.
             */

			if (CurrentZone != null) {
				ContentManager.Unload();
			}
			CurrentZone = new Zone {Name = zoneName};
			// Regions.
			const int regionsWide = 8; // 2 screens wide.
			const int regionsHigh = 2; // 1 screen high.
			for (int i = 0; i < regionsWide; i++) {
				for (int j = 0; j < regionsHigh; j++) {
					CurrentZone.Regions.Add(new Region(i, j));
				}
			}
			CurrentZone.Bounds = new Rectangle(GameEngine.GameBounds.Left,
				GameEngine.GameBounds.Top,
				regionsWide*Region.REGION_WIDTH,
				regionsHigh*Region.REGION_HEIGHT);

			//=====( End Zone Basics )=============================================================
			///////////////////////////////////////////////////////////////////////////////////////
			//=====( Begin Assets )================================================================

            // Songs.
			CurrentZone.Songs.Add("Song1", ContentManager.Load<Song>(@"Music/d_adrian"));

            // SoundEffects.
			CurrentZone.SoundEffects.Add("Shotgun", ContentManager.Load<SoundEffect>(@"Sounds/Weapons/dsshotgn"));
			CurrentZone.SoundEffects.Add("HumanPain", ContentManager.Load<SoundEffect>(@"Sounds/Zombie/TakingHit/dspopain"));
			CurrentZone.SoundEffects.Add("HumanDeath", ContentManager.Load<SoundEffect>(@"Sounds/Zombie/Dying/dspodth3"));

            // SoundEffectInstances.
			CurrentZone.SoundEffectInstances.Add("Shotgun", CurrentZone.SoundEffects["Shotgun"].CreateInstance());
			CurrentZone.SoundEffectInstances.Add("HumanPain", CurrentZone.SoundEffects["HumanPain"].CreateInstance());
			CurrentZone.SoundEffectInstances.Add("HumanDeath", CurrentZone.SoundEffects["HumanDeath"].CreateInstance());

			// Textures.
			CurrentZone.Textures.Add("blank", ContentManager.Load<Texture2D>(@"Images/Blank"));
			CurrentZone.Textures.Add("floor", ContentManager.Load<Texture2D>(@"Images/floor"));
			CurrentZone.Textures.Add("fan", ContentManager.Load<Texture2D>(@"Images/fan"));
			CurrentZone.Textures.Add("cog", ContentManager.Load<Texture2D>(@"Images/cog"));

			// AnimationFrame Lists.
		    IList<AnimationFrame> animationFrames;
		    Texture2D tempTexture;
            //----- BurningBarrel -----
			animationFrames = new List<AnimationFrame>();
			tempTexture = ContentManager.Load<Texture2D>(@"Images/FlamingBarrel/FlamingBarrel_1");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .125f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/FlamingBarrel/FlamingBarrel_2");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .125f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/FlamingBarrel/FlamingBarrel_3");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .125f));
			CurrentZone.AnimationFrameLists.Add("BurningBarrel", animationFrames);
            //----- PlayerIdle -----
            animationFrames = new List<AnimationFrame>();
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Player/Idle/playe3e7");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, 5.25f));
            tempTexture = ContentManager.Load<Texture2D>(@"Images/Player/Idle/playe4e6");
            animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .25f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Player/Idle/playe3e7");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .25f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Player/Idle/playe2e8");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .25f));
			CurrentZone.AnimationFrameLists.Add("PlayerIdle", animationFrames);
            //----- PlayerWalking -----
            animationFrames = new List<AnimationFrame>();
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Player/Walking/playa3a7");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .25f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Player/Walking/playb3b7");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .25f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Player/Walking/playc3c7");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .25f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Player/Walking/playd3d7");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .25f));
			CurrentZone.AnimationFrameLists.Add("PlayerWalking", animationFrames);
            //----- PlayerAttacking -----
            animationFrames = new List<AnimationFrame>();
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Player/Attacking/playf3f7");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .50f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Player/Idle/playe3e7");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .50f));
			CurrentZone.AnimationFrameLists.Add("PlayerAttacking", animationFrames);
            //----- PlayerTakingHit -----
            animationFrames = new List<AnimationFrame>();
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Player/TakingHit/playg3g7");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, 1f));
			CurrentZone.AnimationFrameLists.Add("PlayerTakingHit", animationFrames);
            //----- PlayerDying -----
            animationFrames = new List<AnimationFrame>();
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Player/Dying/playh0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .16f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Player/Dying/playi0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .16f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Player/Dying/playj0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .16f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Player/Dying/playk0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .16f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Player/Dying/playl0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .16f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Player/Dying/playm0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .16f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Player/Dying/playn0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .16f));
			CurrentZone.AnimationFrameLists.Add("PlayerDying", animationFrames);
            //----- PlayerGibbed -----
            animationFrames = new List<AnimationFrame>();
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Player/Gibbed/playo0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .16f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Player/Gibbed/playp0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .16f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Player/Gibbed/playq0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .16f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Player/Gibbed/playr0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .16f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Player/Gibbed/plays0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .16f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Player/Gibbed/playt0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .16f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Player/Gibbed/playu0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .16f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Player/Gibbed/playv0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .16f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Player/Gibbed/playw0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .16f));
			CurrentZone.AnimationFrameLists.Add("PlayerGibbed", animationFrames);
            //----- ZombieIdle -----
            animationFrames = new List<AnimationFrame>();
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Zombie/Idle/posse3e7");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, 5.25f));
            tempTexture = ContentManager.Load<Texture2D>(@"Images/Zombie/Idle/posse4e6");
            animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .25f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Zombie/Idle/posse3e7");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .25f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Zombie/Idle/posse2e8");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .25f));
			CurrentZone.AnimationFrameLists.Add("ZombieIdle", animationFrames);
            //----- ZombieWalking -----
            animationFrames = new List<AnimationFrame>();
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Zombie/Walking/possa3a7");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .25f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Zombie/Walking/possb3b7");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .25f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Zombie/Walking/possc3c7");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .25f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Zombie/Walking/possd3d7");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .25f));
			CurrentZone.AnimationFrameLists.Add("ZombieWalking", animationFrames);
            //----- ZombieAttacking -----
            animationFrames = new List<AnimationFrame>();
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Zombie/Attacking/possf3f7");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .16f));
			CurrentZone.AnimationFrameLists.Add("ZombieAttacking", animationFrames);
            //----- ZombieTakingHit -----
            animationFrames = new List<AnimationFrame>();
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Zombie/TakingHit/possg3g7");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, 1f));
			CurrentZone.AnimationFrameLists.Add("ZombieTakingHit", animationFrames);
            //----- ZombieDying -----
            animationFrames = new List<AnimationFrame>();
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Zombie/Dying/possh0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .2f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Zombie/Dying/possi0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .2f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Zombie/Dying/possj0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .2f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Zombie/Dying/possk0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .2f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Zombie/Dying/possl0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .2f));
			CurrentZone.AnimationFrameLists.Add("ZombieDying", animationFrames);
            //----- ZombieDead -----
            animationFrames = new List<AnimationFrame>();
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Zombie/Dying/possl0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, 1f));
			CurrentZone.AnimationFrameLists.Add("ZombieDead", animationFrames);
            //----- ZombieGibbed -----
            animationFrames = new List<AnimationFrame>();
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Zombie/Gibbed/possm0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .16f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Zombie/Gibbed/possn0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .16f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Zombie/Gibbed/posso0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .16f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Zombie/Gibbed/possp0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .16f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Zombie/Gibbed/possq0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .16f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Zombie/Gibbed/possr0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .16f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Zombie/Gibbed/posss0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .16f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Zombie/Gibbed/posst0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .16f));
			tempTexture = ContentManager.Load<Texture2D>(@"Images/Zombie/Gibbed/possu0");
			animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, .16f));
            CurrentZone.AnimationFrameLists.Add("ZombieGibbed", animationFrames);
            //----- ZombieGoo -----
            animationFrames = new List<AnimationFrame>();
            tempTexture = ContentManager.Load<Texture2D>(@"Images/Zombie/Gibbed/possu0");
            animationFrames.Add(new AnimationFrame(tempTexture, tempTexture.Bounds, Vector2.Zero, 1f));
            CurrentZone.AnimationFrameLists.Add("ZombieGoo", animationFrames);

			//=====( End Assets )==================================================================
            ///////////////////////////////////////////////////////////////////////////////////////
            //=====( Begin Player )================================================================

            Body playerBody = new Body((int) (GameEngine.GameBounds.Width/2f)-20, CurrentZone.Floor-CurrentZone.AnimationFrameLists["PlayerIdle"][0].Bounds.Height); // Set initial position.
            PlayerMovement playerMovement = new PlayerMovement(playerBody, PlayerMovement.WALKING_SPEED);
			Appearance appearance = new Appearance(playerBody);
		    Animation playerIdle = new Animation("PlayerIdle", playerBody, appearance, CurrentZone.AnimationFrameLists["PlayerIdle"]);
		    Animation playerWalking = new Animation("PlayerWalking", playerBody, appearance, CurrentZone.AnimationFrameLists["PlayerWalking"]);
		    Animation playerAttacking = new Animation("PlayerAttacking", playerBody, appearance, CurrentZone.AnimationFrameLists["PlayerAttacking"]);
            PlayerStateMachine playerState = new PlayerStateMachine(playerIdle, playerWalking, playerAttacking, playerBody, playerMovement, appearance);
			GameEngine.Player = new Player(playerBody, appearance, playerState, playerMovement);

            //=====( End Player )==================================================================
            ///////////////////////////////////////////////////////////////////////////////////////
            //=====( Begin Config )================================================================

            GameEngine.Camera.Mode = CameraMode.Play;
			GameEngine.Camera.IsFollowingPlayer = true;
		    MediaPlayer.IsRepeating = true;
			CurrentZone.Floor = CurrentZone.Bounds.Bottom-(CurrentZone.Textures["floor"].Height);

            //=====( End Config )==================================================================
			///////////////////////////////////////////////////////////////////////////////////////
			//=====( Begin GameObjects )===========================================================

			BuildDoomZone1();
			
            //=====( End GameObjects )=============================================================
		}

	    public static void UnloadZone() {
	        ContentManager.Unload();
	    }

		private static void BuildDoomZone1() {

			Actor actor;
			Rectangle bounds;
			int scale = 1;
            Body body;
			ZombieMovement zombieMovement;
		    Appearance appearance;
		    Animation animation;
			Animation zombieIdle;
			Animation zombieWalking;
			Animation zombieTakingHit;
			Animation zombieDying;
			Animation zombieDead;
			Animation zombieGibbed;
			Animation zombieGoo;
			ZombieStateMachine zombieState;
			ZombieHealth zombieHealth;
			ZombieMind zombieMind;

			//-----( PlayerLevelGameObjects )-----

			/*
			 * The Components are built in 'reverse-order' so that dependencies can be linked.
			 *  - Body
			 *  - Movement
			 *  - Appearance
			 *  - Animation[]
			 *  - State
			 *  - Mind
			 */

			bounds = CurrentZone.Textures["floor"].Bounds;
			// Floor.
			for (int i = 0; i < 80; i++) {
				body = new Body(i*bounds.Width, CurrentZone.Floor, bounds.Width, bounds.Height);
				appearance = new Appearance(body, CurrentZone.Textures["floor"]);
				actor = new Sprite("Floor"+i, body, appearance);
				CurrentZone.PlayerLevelActors.Add(actor);
			}

            // Zombies
			// 0
		    bounds = CurrentZone.AnimationFrameLists["ZombieIdle"][0].Bounds;
			body = new Body(200, CurrentZone.Floor-bounds.Height, bounds.Width, bounds.Height, facingDirection:FacingDirection.Left); // Set initial position.
            zombieMovement = new ZombieMovement(body);
		    appearance = new Appearance(body);
		    zombieIdle = new Animation("ZombieIdle", body, appearance, CurrentZone.AnimationFrameLists["ZombieIdle"]);
		    zombieWalking = new Animation("ZombieWalking", body, appearance, CurrentZone.AnimationFrameLists["ZombieWalking"]);
		    zombieTakingHit = new Animation("ZombieTakingHit", body, appearance, CurrentZone.AnimationFrameLists["ZombieTakingHit"]);
		    zombieDying = new Animation("ZombieDying", body, appearance, CurrentZone.AnimationFrameLists["ZombieDying"]);
		    zombieDead = new Animation("ZombieDead", body, appearance, CurrentZone.AnimationFrameLists["ZombieDead"]);
		    zombieGibbed = new Animation("ZombieGibbed", body, appearance, CurrentZone.AnimationFrameLists["ZombieGibbed"]);
		    zombieGoo = new Animation("ZombieGoo", body, appearance, CurrentZone.AnimationFrameLists["ZombieGoo"]);
            zombieState = new ZombieStateMachine(zombieMovement, appearance, zombieIdle, zombieWalking, zombieTakingHit, zombieDying, zombieDead, zombieGibbed, zombieGoo);
			zombieHealth = new ZombieHealth(zombieState, 70);
            zombieMind = new ZombieMind(zombieState);
			actor = new Zombie("Zombie_0", body, appearance, zombieMind, zombieHealth);
			CurrentZone.PlayerLevelActors.Add(actor);
			// 1
		    bounds = CurrentZone.AnimationFrameLists["ZombieIdle"][0].Bounds;
			body = new Body(400, CurrentZone.Floor-bounds.Height, bounds.Width, bounds.Height, facingDirection:FacingDirection.Left); // Set initial position.
            zombieMovement = new ZombieMovement(body);
		    appearance = new Appearance(body);
		    zombieIdle = new Animation("ZombieIdle", body, appearance, CurrentZone.AnimationFrameLists["ZombieIdle"]);
		    zombieWalking = new Animation("ZombieWalking", body, appearance, CurrentZone.AnimationFrameLists["ZombieWalking"]);
		    zombieTakingHit = new Animation("ZombieTakingHit", body, appearance, CurrentZone.AnimationFrameLists["ZombieTakingHit"]);
		    zombieDying = new Animation("ZombieDying", body, appearance, CurrentZone.AnimationFrameLists["ZombieDying"]);
		    zombieDead = new Animation("ZombieDead", body, appearance, CurrentZone.AnimationFrameLists["ZombieDead"]);
		    zombieGibbed = new Animation("ZombieGibbed", body, appearance, CurrentZone.AnimationFrameLists["ZombieGibbed"]);
		    zombieGoo = new Animation("ZombieGoo", body, appearance, CurrentZone.AnimationFrameLists["ZombieGoo"]);
            zombieState = new ZombieStateMachine(zombieMovement, appearance, zombieIdle, zombieWalking, zombieTakingHit, zombieDying, zombieDead, zombieGibbed, zombieGoo);
			zombieHealth = new ZombieHealth(zombieState, 70);
            zombieMind = new ZombieMind(zombieState);
			actor = new Zombie("Zombie_1", body, appearance, zombieMind, zombieHealth);
			CurrentZone.PlayerLevelActors.Add(actor);
			// 2
		    bounds = CurrentZone.AnimationFrameLists["ZombieIdle"][0].Bounds;
			body = new Body(600, CurrentZone.Floor-bounds.Height, bounds.Width, bounds.Height, facingDirection:FacingDirection.Left); // Set initial position.
            zombieMovement = new ZombieMovement(body);
		    appearance = new Appearance(body);
		    zombieIdle = new Animation("ZombieIdle", body, appearance, CurrentZone.AnimationFrameLists["ZombieIdle"]);
		    zombieWalking = new Animation("ZombieWalking", body, appearance, CurrentZone.AnimationFrameLists["ZombieWalking"]);
		    zombieTakingHit = new Animation("ZombieTakingHit", body, appearance, CurrentZone.AnimationFrameLists["ZombieTakingHit"]);
		    zombieDying = new Animation("ZombieDying", body, appearance, CurrentZone.AnimationFrameLists["ZombieDying"]);
		    zombieDead = new Animation("ZombieDead", body, appearance, CurrentZone.AnimationFrameLists["ZombieDead"]);
		    zombieGibbed = new Animation("ZombieGibbed", body, appearance, CurrentZone.AnimationFrameLists["ZombieGibbed"]);
		    zombieGoo = new Animation("ZombieGoo", body, appearance, CurrentZone.AnimationFrameLists["ZombieGoo"]);
            zombieState = new ZombieStateMachine(zombieMovement, appearance, zombieIdle, zombieWalking, zombieTakingHit, zombieDying, zombieDead, zombieGibbed, zombieGoo);
			zombieHealth = new ZombieHealth(zombieState, 70);
            zombieMind = new ZombieMind(zombieState);
			actor = new Zombie("Zombie_2", body, appearance, zombieMind, zombieHealth);
			CurrentZone.PlayerLevelActors.Add(actor);
			// 3
		    bounds = CurrentZone.AnimationFrameLists["ZombieIdle"][0].Bounds;
			body = new Body(800, CurrentZone.Floor-bounds.Height, bounds.Width, bounds.Height, facingDirection:FacingDirection.Left); // Set initial position.
            zombieMovement = new ZombieMovement(body);
		    appearance = new Appearance(body);
		    zombieIdle = new Animation("ZombieIdle", body, appearance, CurrentZone.AnimationFrameLists["ZombieIdle"]);
		    zombieWalking = new Animation("ZombieWalking", body, appearance, CurrentZone.AnimationFrameLists["ZombieWalking"]);
		    zombieTakingHit = new Animation("ZombieTakingHit", body, appearance, CurrentZone.AnimationFrameLists["ZombieTakingHit"]);
		    zombieDying = new Animation("ZombieDying", body, appearance, CurrentZone.AnimationFrameLists["ZombieDying"]);
		    zombieDead = new Animation("ZombieDead", body, appearance, CurrentZone.AnimationFrameLists["ZombieDead"]);
		    zombieGibbed = new Animation("ZombieGibbed", body, appearance, CurrentZone.AnimationFrameLists["ZombieGibbed"]);
		    zombieGoo = new Animation("ZombieGoo", body, appearance, CurrentZone.AnimationFrameLists["ZombieGoo"]);
            zombieState = new ZombieStateMachine(zombieMovement, appearance, zombieIdle, zombieWalking, zombieTakingHit, zombieDying, zombieDead, zombieGibbed, zombieGoo);
			zombieHealth = new ZombieHealth(zombieState, 70);
            zombieMind = new ZombieMind(zombieState);
			actor = new Zombie("Zombie_3", body, appearance, zombieMind, zombieHealth);
			CurrentZone.PlayerLevelActors.Add(actor);
			// 4
		    bounds = CurrentZone.AnimationFrameLists["ZombieIdle"][0].Bounds;
			body = new Body(1000, CurrentZone.Floor-bounds.Height, bounds.Width, bounds.Height, facingDirection:FacingDirection.Left); // Set initial position.
            zombieMovement = new ZombieMovement(body);
		    appearance = new Appearance(body);
		    zombieIdle = new Animation("ZombieIdle", body, appearance, CurrentZone.AnimationFrameLists["ZombieIdle"]);
		    zombieWalking = new Animation("ZombieWalking", body, appearance, CurrentZone.AnimationFrameLists["ZombieWalking"]);
		    zombieTakingHit = new Animation("ZombieTakingHit", body, appearance, CurrentZone.AnimationFrameLists["ZombieTakingHit"]);
		    zombieDying = new Animation("ZombieDying", body, appearance, CurrentZone.AnimationFrameLists["ZombieDying"]);
		    zombieDead = new Animation("ZombieDead", body, appearance, CurrentZone.AnimationFrameLists["ZombieDead"]);
		    zombieGibbed = new Animation("ZombieGibbed", body, appearance, CurrentZone.AnimationFrameLists["ZombieGibbed"]);
		    zombieGoo = new Animation("ZombieGoo", body, appearance, CurrentZone.AnimationFrameLists["ZombieGoo"]);
            zombieState = new ZombieStateMachine(zombieMovement, appearance, zombieIdle, zombieWalking, zombieTakingHit, zombieDying, zombieDead, zombieGibbed, zombieGoo);
			zombieHealth = new ZombieHealth(zombieState, 70);
            zombieMind = new ZombieMind(zombieState);
			actor = new Zombie("Zombie_4", body, appearance, zombieMind, zombieHealth);
			CurrentZone.PlayerLevelActors.Add(actor);

			//-----( BackgroundGameObjects )------
			// scale = 2;
			bounds = CurrentZone.AnimationFrameLists["BurningBarrel"][0].Bounds;
		    body = new Body(500, CurrentZone.Floor-bounds.Height*scale, bounds.Width*scale, bounds.Height*scale, layerDepth: 1.5f);
		    appearance = new Appearance(body, CurrentZone.Textures["blank"]);
		    animation = new Animation("BurningBarrel", body, appearance, CurrentZone.AnimationFrameLists["BurningBarrel"]);
			actor = new AnimatedSprite("BurningBarrel_0", body, appearance, animation);
			CurrentZone.BackgroundActors.Add(actor);

			//-----( Song )-----------------------
		    CurrentZone.CurrentSong = CurrentZone.Songs["Song1"];
			MediaPlayer.Play(CurrentZone.CurrentSong);
		}

	}

}